﻿using System.Collections.Generic;
using Core.Threading.ThreadPools.TaskItems;

namespace Core.Threading.ThreadPools.TaskQueues
{
    /// <summary>
    /// Represent default task queue, does not validate TaskItemPriority
    /// </summary>
    public sealed class DefaultTaskQueue : ITaskQueue
    {
        private readonly Queue<WorkItem> _queue = new Queue<WorkItem>();

        #region Implementation of ITaskQueue

        public int Count
        {
            get { return _queue.Count; }
        }

        public void Enqueue(WorkItem item)
        {
            _queue.Enqueue(item);
        }

        public WorkItem Dequeue()
        {
            return _queue.Dequeue();
        }

        #endregion
    }
}